﻿#pragma once

#include "BaseGlobal.h"
#include "RecordTable.h"
#include "RecordTableModel.h"
//==================================================================================================
//自定义表模型
class BASE_EXPORT QRecordCheckTableModel : public QRecordTableModel
{
	Q_OBJECT
public:
	QRecordCheckTableModel(bool isCheck = false,QObject * parent = NULL);
	~QRecordCheckTableModel();

public:
	bool select(QString sql, bool isCheck = false);
	virtual Qt::ItemFlags flags(const QModelIndex &index) const;
	virtual QVariant data(const QModelIndex &index, int role) const;
	virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
	bool getChecked(int row);

public:
	virtual QModelIndex insertRow(QVariantList & value, bool bSeq = true);
	virtual bool deleteRow(QModelIndex index);
	virtual bool deleteRow(int row);

private:
	QList<bool> listCheck;
	bool isShowCheck;
};

